﻿using System.Linq;
//using Microsoft.WindowsAzure;
//using Microsoft.WindowsAzure.Diagnostics;
//using Microsoft.WindowsAzure.ServiceRuntime;

namespace Odp.DataServices
{
    public class WebRole// : RoleEntryPoint
    {
        public /*override*/ bool OnStart()
        {
          //sl-king
					//uses azure but it is unused
					//it is called only when loaded in Azure
					return false;
						//DiagnosticMonitor.Start("DiagnosticsConnectionString");

						//// For information on handling configuration changes
						//// see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
						//RoleEnvironment.Changing += RoleEnvironmentChanging;

						//// This code sets up a handler to update CloudStorageAccount instances when their corresponding
						//// configuration settings change in the service configuration file.
						//CloudStorageAccount.SetConfigurationSettingPublisher((configName, configSetter) =>
						//{
						//    configSetter(RoleEnvironment.GetConfigurationSettingValue(configName));
						//    RoleEnvironment.Changed += (sender, arg) =>
						//    {
						//        if (arg.Changes.OfType<RoleEnvironmentConfigurationSettingChange>()
						//            .Any((change) => (change.ConfigurationSettingName == configName)))
						//        {
						//            if (!configSetter(RoleEnvironment.GetConfigurationSettingValue(configName)))
						//            {
						//                RoleEnvironment.RequestRecycle();
						//            }
						//        }
						//    };
						//});

						//return base.OnStart();
        }

        private void RoleEnvironmentChanging(object sender/*, RoleEnvironmentChangingEventArgs e*/)
        {
            //sl-king
					//uses azure but it is unused
						//// If a configuration setting is changing
						//if (e.Changes.Any(change => change is RoleEnvironmentConfigurationSettingChange))
						//{
						//    // Set e.Cancel to true to restart this role instance
						//    e.Cancel = true;
						//}
        }
    }
}
